<include file="../Public/header" />

<!-- 主体内容 -->
<div id="content" msgpage="msg_list">
<include file="../Public/message_header" />
<volist name="data" id="message">
		<div class="c_msg" msid="{$message.list_id}">
			<div class="c_info">
				<div class="c_ava">
					<img src="<php> if($message['last_message']['user_info']['uid'] == $mid){</php>
						{$message['to_user_info'][$message['last_message']['to_uid'][0]]['avatar_middle']}
					<php>}elseif($message['last_message']['user_info']['uid'] != $mid){</php>
						{$message['last_message']['user_info']['avatar_middle']}
					<php>}</php>" width=40 height=40>
				</div>
				<div class="info_text">
					<div class="c_info_name">
						<php> if($message['last_message']['user_info']['uid'] == $mid){</php>
                            <php>
                            	$sendToUserInfo = getSubByKey($message['to_user_info'], 'uname');
                            </php>
                            	{:L('PUBLIC_SENTTO')} {:implode('、', $sendToUserInfo)}：
                            <php>}else{</php>
                            	{$message.last_message.user_info.uname}{:L('PUBLIC_SAY')}：
                        	<php>}</php>
                        <br/>
                    </div>
					<div class="c_time">{$message.list_ctime|friendlyDate}</div>
				</div>
			</div>
			<div class="c_content">
				<php>echo wapFormatContent($message['last_message']['content']);</php>
			</div>
		</div>
</volist>

	<!-- 分页 -->
	<div id="pager_box">
		<php>
			$p = empty($_GET['p']) ? $p=1 : $p = $_GET['p'];
			if(empty($_GET['p']) || $_GET['p']==1){</php>
			<a href="javascript:;" link="" id="prev" class="pager_child pager_p_n_none ">上一页</a>
		<php>}else{</php>
			<a href="javascript:;" link="{:U('w3g/Message/index',array('p'=>$p-1))}" id="prev" class="pager_child pager_p_n ">上一页</a>
		<php>}</php>
		<!-- <select id="page_sel" class="pager_child">
			<php>
				$_GET['page']!=0?$get=$_GET['page']:$get=1;
				$_count = ceil($count/10);
				if($get<6){
					for($i=0;$i<($_count);$i++){
						$get==$i+1?$selected='selected="selected"':$selected='';
						if($i>9){
							break;
						}
			</php>
			<option value="{:U('w3g/Message/index')}&page={$i+1}" <php>echo $selected;</php>>第{$i+1}页</option>
			<php>	}
				}elseif($get>=6){
					for($i=($get-5);$i<$get;$i++){
						$get==$i+1?$selected='selected="selected"':$selected='';
			</php>
			<option value="{:U('w3g/Message/index')}&page={$i+1}" <php>echo $selected;</php>>第{$i+1}页</option>
			<php>	}</php>
			<php>	for($i=$get;$i<($get+5);$i++){
						$get==$i+1?$selected='selected="selected"':$selected='';
						if($i>$_count-1){
							break;
						}
			</php>
			<option value="{:U('w3g/Message/index')}&page={$i+1}" <php>echo $selected;</php>>第{$i+1}页</option>
			<php>	}</php>
			<php>}</php>
			
		</select> -->
		<php>if($_GET['p'] >= $tpage) {</php>
			<a href="javascript:;" link="" id="next" class="pager_child pager_p_n_none">下一页</a>
		<php>}else{</php>
			<a href="javascript:;" link="{:U('w3g/Message/index',array('p'=>$p+1))}" id="next" class="pager_child pager_p_n">下一页</a>
		<php>}</php>
	</div>
</div>
<script type="text/javascript">
LazyLoad.js(["js/z.message_list.js"], function(){
	console.log("message->detail->script->loaded!");
});
</script>
	<!-- 列表结束################################################################################################ -->
<include file="../Public/footer" />